﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using NUnit.Framework;

namespace SyringeControl.AssemblySelectors.Tests
{
    [TestFixture]
    class Test_PathAssemblySelector
    {
        [TestCase(@"%WINDIR%\Microsoft.NET\Framework\v2.0.50727\System.Windows.Forms.dll")]
        public void Loads_assembly_from_path(string path)
        {
            var selector = new PathAssemblySelector(Environment.ExpandEnvironmentVariables(path));
            var assembly = selector.SelectAssembly();
            Assert.That(assembly, Is.Not.Null);
        }

        [TestCase(@"%WINDIR%\Microsoft.NET\Framework\v2.0.50727\System.ServiceModel.dll")]
        public void Returns_null_if_assembly_cannot_be_located(string path)
        {
            var selector = new PathAssemblySelector(Environment.ExpandEnvironmentVariables(path));
            var assembly = selector.SelectAssembly();
            Assert.That(assembly, Is.Null);
        }
    }
}
